package com.photoeditor.demo.model.image.emoji;

import android.content.Context;
import android.content.res.Resources;

/**
 * emoji资源的基类
 */
public abstract class StickerApkResource {

    protected String mName;

    protected boolean mInit = false;

    //Emoji name
    protected String[] mEmojiNames;

    //外置未安装Apk的Res
    protected Resources mRes;

    //包名
    protected String mPkgName;

    //是否存在
    protected boolean isExist;

    //一行的Emoji的数目
    protected int mEmojiColNum;

    //一页的Emoji的数目
    protected int mEmojiPageNum;

    //两行之间的间距
    protected int mVerticalSpacing;

    //两列之间的间距 这个暂时没有作用  现在是左右居中的
    protected int mHorizontalSpacing;

    //一个的Emoji的宽度
    protected int mEmojiWidth;

    //一个的Emoji的高度
    protected int mEmojiHeight;

    //一个的item的宽度
    protected int mItemWidth;

    //一个的item的高度
    protected int mItemHeight;

    //一个的page的高度
    protected int mPageHeight;

    //合成时Emoji显示的宽
    protected int mEditEmojiWidth;

    //合成时Emoji显示的高
    protected int mEditEmojiHeight;

    //是否需要购买
    protected boolean mNeedBuy = false;

    //是否已经购买
    protected boolean mAlreadyBuy = false;

    protected int mStickerIconId;

    //emoji pannel的背景颜色  2016-9-28新增
    private int mBgColor;

    protected boolean mIsDownloadOnGP = false;

    public StickerApkResource(String pkgName) {
        mPkgName = pkgName;
    }

    public StickerApkResource(String pkgName, Resources resources) {
        mPkgName = pkgName;
        mRes = resources;
    }


    public void init(Context context, boolean needInit) {
    }

    ;

    public void init(Context context, String zipPath, boolean needInit) {
    }

    ;

    public void init(Context context, int iconRes) {
    }

    ;

    public void init(Context context, String pkhName, String name) {
    }

    ;

    public void init(Context context) {
    }

    ;

    public void doInit() {
        mInit = true;
    }

    public String[] getEmojiNames() {
        return mEmojiNames;
    }

    public void setEmojiNames(String[] mEmojiNames) {
        this.mEmojiNames = mEmojiNames;
    }

    public String getPkgName() {
        return mPkgName;
    }

    public void setPkgName(String mPkgName) {
        this.mPkgName = mPkgName;
    }

    public boolean isExist() {
        return isExist;
    }

    public void setIsExist(boolean isExist) {
        this.isExist = isExist;
    }

    public int getEmojiColNum() {
        return mEmojiColNum;
    }

    public void setEmojiColNum(int mEmojiColNum) {
        this.mEmojiColNum = mEmojiColNum;
    }

    public int getEmojiPageNum() {
        return mEmojiPageNum;
    }

    public void setEmojiPageNum(int mEmojiPageNum) {
        this.mEmojiPageNum = mEmojiPageNum;
    }

    public int getEmojiWidth() {
        return mEmojiWidth;
    }

    public void setEmojiWidth(int mEmojiWidth) {
        this.mEmojiWidth = mEmojiWidth;
    }

    public int getEmojiHeight() {
        return mEmojiHeight;
    }

    public void setEmojiHeight(int mEmojiHeight) {
        this.mEmojiHeight = mEmojiHeight;
    }

    public int getVerticalSpacing() {
        return mVerticalSpacing;
    }

    public void setVerticalSpacing(int mVerticalSpacing) {
        this.mVerticalSpacing = mVerticalSpacing;
    }

    public int getHorizontalSpacing() {
        return mHorizontalSpacing;
    }

    public void setHorizontalSpacing(int mHorizontalSpacing) {
        this.mHorizontalSpacing = mHorizontalSpacing;
    }

    public int getItemWidth() {
        return mItemWidth;
    }

    public void setItemWidth(int mItemWidth) {
        this.mItemWidth = mItemWidth;
    }

    public int getItemHeight() {
        return mItemHeight;
    }

    public void setItemHeight(int mItemHeight) {
        this.mItemHeight = mItemHeight;
    }

    public int getPageHeight() {
        return mPageHeight;
    }

    public void setPageHeight(int mPageHeight) {
        this.mPageHeight = mPageHeight;
    }

    public int getEditEmojiWidth() {
        return mEditEmojiWidth;
    }

    public void setEditEmojiWidth(int mEditEmojiWidth) {
        this.mEditEmojiWidth = mEditEmojiWidth;
    }

    public int getEditEmojiHeight() {
        return mEditEmojiHeight;
    }

    public void setEditEmojiHeight(int mEditEmojiHeight) {
        this.mEditEmojiHeight = mEditEmojiHeight;
    }

    public Resources getRes() {
        return mRes;
    }

    public void setRes(Resources mRes) {
        this.mRes = mRes;
    }

    public boolean isAlreadyBuy() {
        return mAlreadyBuy;
    }

    public void setAlreadyBuy(boolean mAlreadyBuy) {
        this.mAlreadyBuy = mAlreadyBuy;
    }

    public boolean isNeedBuy() {
        return mNeedBuy;
    }

    public void setNeedBuy(boolean mNeedBuy) {
        this.mNeedBuy = mNeedBuy;
    }

    public int getStickerIconId() {
        return mStickerIconId;
    }

    public void setStickerIconId(int mStickerIconId) {
        this.mStickerIconId = mStickerIconId;
    }

    //能否使用
    public boolean canUse() {
        if (isNeedBuy()) {
            return isAlreadyBuy();
        } else {
            return true;
        }
    }

    public String getName() {
        return mName;
    }

    public void setName(String mName) {
        this.mName = mName;
    }

    public boolean isInit() {
        return mInit;
    }

    public void setInit(boolean mInit) {
        this.mInit = mInit;
    }

    public int getBgColor() {
        return mBgColor;
    }

    public void setBgColor(int mBgColor) {
        this.mBgColor = mBgColor;
    }

    public boolean isDownloadOnGP() {
        return mIsDownloadOnGP;
    }

    public void setDownloadOnGP(boolean downloadOnGP) {
        mIsDownloadOnGP = downloadOnGP;
    }
}
